package org.bridgen.runtime.model;

import java.util.ArrayList;

import org.bridgen.runtime.util.Interval;

/**
 * 
 * @author Emma Söderberg <emma add cs.lth.se>
 *
 */

public class AmbNode extends LexicalNode {

	private ArrayList<LexicalNode> nextList;
	
	public AmbNode(LexicalNode previous, Interval interval) {
		this(previous, interval, "");
		
	}
	
	public AmbNode(LexicalNode previous, Interval interval, String value) {
		super(previous, interval, value);
		nextList = new ArrayList<LexicalNode>();
	}
	
	public void addAmbNext(LexicalNode nextNode) {
		nextList.add(nextNode);
	}
	
	public void removeAmbNextAt(int index) {
		nextList.remove(index);
	}

	@Override
	public LexicalNode clone(LexicalNode previous) {
		return new AmbNode(previous, interval.clone());
	}

	public ArrayList<LexicalNode> nextOptions() {
		return nextList;
	}
}
